package com.qiyu.tech.web.starter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author linhao
 * @date 2019/7/29
 * @Version V1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Resource
    private AccessControlInterceptor accessControllerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册登录拦截器
        registry.addInterceptor(accessControllerInterceptor).addPathPatterns("/**");
    }
}
